package com.wongoing.util.manager;

import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
 * 功能说明：验证码内存管理内
 * 修改说明：
 * @author 吴兆强
 * @date 2018年1月25日 上午11:15:28
 * @version V0.1
 */
public class EmailVerCodeManager {
	
	private static EmailVerCodeManager instance = new EmailVerCodeManager();
	
	private EmailVerCodeManager(){
		
	}
	
	public static EmailVerCodeManager getInstance(){
		if(null == instance) instance = new EmailVerCodeManager();
		return instance;
	}
	
	private Map<String,EmailVerCodeManagerBean> map = new HashMap<String, EmailVerCodeManagerBean>();
	
	public void addVerCode(String tel,EmailVerCodeManagerBean vercode){
		map.put(tel, vercode);
	}
	
	public void removeVerCode(String tel){
		map.remove(tel);
	}
	
	public EmailVerCodeManagerBean getVerCode(String tel){
		return map.get(tel);
	}
	
	public Collection<EmailVerCodeManagerBean> getAllVerCode(){
		return map.values();
	}

}
